package cn.zmwh.common.core.utils;

/**
 * 序列号工具类
 *
 * @author unsky
 * @date 2019-01-25 15:14
 * @vserion 1.0
 */
public class SNUtils {

    private static char[] numCodes = {'1', '2', '3', '4', '5', '6', '7', '8', '9', '0'};

    /**
     * 生成6位短信验证码
     *
     * @return
     */
    public static String genSMSCode() {
        StringBuilder randomCode = new StringBuilder();
        for (int i = 0; i < 6; i++) {
            randomCode.append(numCodes[(int) (Math.random() * 10)]);
        }
        return randomCode.toString();
    }
}
